const { ccclass, property } = cc._decorator;

@ccclass
export default class PoolItem extends cc.Component {
    private _pool: any = null;
    private _gid: any = null;
    private _using: boolean = false;
    private _loaded: boolean = false;
    private _data: boolean = false;

    reuse() {
        this._using = true;
    }

    init() { }

    registPool(pool: any, gid: any) {
        this._pool = pool;
        this._gid = gid;
        this._using = true;
    }

    clear() { }

    recover() {
        if (this._using) {
            this._using = false;
            this.node.removeFromParent(false);
            this.clear();
            this._pool.push(this.node);
        }
    }
}
